package diffOfRemoteAndLocal.client;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import diffOfRemoteAndLocal.MyUser;
import diffOfRemoteAndLocal.MyUserManagerRemote;

public class MyUserManagerClient {

	/**
	 * @param args
	 * @throws NamingException 
	 */
	public static void main(String[] args) throws NamingException {
		InitialContext context = new InitialContext();
		MyUserManagerRemote userManager = (MyUserManagerRemote)context.lookup("MyUserManagerBean/remote");
		MyUser user = new MyUser();
		user.setName("姓名");
		user.setPassword("密码");
		userManager.addUser(user);
		System.out.println(user.getId());
	}

}
